package com.easylive.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: yudaxian
 * @Description: 用户状态
 * @DateTime: 2024/11/2 19:46
 **/
@AllArgsConstructor
@Getter
public enum UserStatusEnum {
    NORMAL(1, "正常"),
    DISABLED(0, "禁用"),
    ;
    private Integer code;

    private String desc;

    public static UserStatusEnum getByCode(Integer code) {
        for (UserStatusEnum status : UserStatusEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
